package com.jiakai.cashinterfacemucon.dao;

import com.jiakai.cashinterfacemucon.model.Product;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


public interface ProductMapper {
    int deleteByPrimaryKey(String productId);

    int insert(Product record);

    int insertSelective(Product record);

    Product selectByPrimaryKey(String productId);

    int updateByPrimaryKeySelective(Product record);

    int updateByPrimaryKey(Product record);

    List<Product> findAllProductId();

    List<Product> findAll();

    @Select("SELECT pt.productId,pt.productName,pt.createTime,pt.productType,pt.parkID,pt.parkCode,pt.parkName," +
            "pt.productCode,pt.productPrice,pt.isTheatre FROM t_products AS pt " +
            "WHERE pt.productId not in (" +
            "SELECT rt.PID3rd FROM t_relations AS rt) " +
            "ORDER BY pt.productName ")
    List<Product> findAllUnbind();
}